package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-12-05
 * Time: 21:46
 */
@Mapper //此注解一定不能忽略
public interface UserMapper {
    public List<UserInfo> getAll();
    public UserInfo getUserById(@Param("uid") Integer id);
    public List<UserInfo> getUserByName(@Param("username") String username);
    //添加用户

    public int add(@Param("username") String username,@Param("password") String password,@Param("photo") String photo);
    //多条用户的删除
    public int delByIds(@Param("ids") List<Integer> ids);
    //根据id修改用户名和密码
    public int updateById(@Param("id") Integer id,@Param("username") String username,@Param("password") String password);
}
